import urllib2

class disk_proxy(object):
    def __init__(self, url):
        self.url = url
        
    def upload(self, filename, data):
        req = urllib2.Request(self.url + "/upload/?filename=" + filename, data)
        respon = urllib2.urlopen(req)
        result = respon.read()
        return result
    
    def download(self, filename):
        req = urllib2.Request(self.url + "/download/?filename=" + filename)
        resp = urllib2.urlopen(req)
        result = resp.read()
        return result

